<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<% 
String e_name=request.getParameter("employee_name");
StringBuffer e_notice=new StringBuffer(request.getParameter("notice"));
int loc = (new String(e_notice)).indexOf('\n');
while(loc > 0){
e_notice.replace(loc, loc+1, "<BR>");
loc = (new String(e_notice)).indexOf('\n');
}
%>
<%
String query="update employee set employee.notice='"+e_notice+"'"+"where employee.name='"+e_name+"'";
Connection db_conn = null;
Statement statement = null;
PreparedStatement pstmt;
ResultSet rs;
try{
Class.forName("com.mysql.jdbc.Driver");
String url= "jdbc:mysql://localhost:3306/db";
db_conn = DriverManager.getConnection( url,"root", "root" );
statement = db_conn.createStatement();
statement.executeUpdate(query);

db_conn.close();
} catch(SQLException e){
e.printStackTrace();
out.println("sql not found");
out.println(e);
} catch(ClassNotFoundException e){
e.printStackTrace();
out.println(e);
}
%>            



